
<h1>Booking #<?php echo $booking->getId(); ?></h1>

<?php
    $packages = config('packages');
    $adultPlatters = config('adultPlatters');
    $moreOptions = config('moreOptions');
    
    $options = $booking->decodePartyOptions();
?>

<div class="section">
    <div class="sectionBody">

        <div class="row">
            <div class="label"><span class="title">Party type</span></div>
            <div class="field">
                <?php echo $booking->getPartyType(); ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelGuestCount'); ?></span></div>
            <div class="field">
                <?php echo $booking->getGuestCount(); ?>
            </div>
            <div class="clear"></div>
        </div>

        <div class="row totalCost">
            <div class="label"><span class="title"><?php echo text('totalCost'); ?></span></div>
            <div class="field">
                $<?php echo $booking->calculateCost(); ?>
            </div>
            <div class="clear"></div>
        </div>
    
    </div>
</div>

<div class="section">

    <h2 class="foodOptions"><?php echo text('headingFoodOptions'); ?></h2>
    
    <div class="sectionBody">
        
        <?php
            function printFoodLists($foodList, $type, $count, $values) {
                global $options;
                
                for ($i = 1; $i <= $count; $i++) {
                    ?>
                        <div class="row <?php echo $type; ?>" id="<?php echo $type . '_' . $i; ?>">
                            <div class="label"><span class="title"><?php echo text($type, array('number' => $i)); ?></span></div>
                            <div class="field">
                                <?php echo $values[$i]; ?>
                            </div>
                            <div class="clear"></div>
                        </div>
                    <?php
                }
            }
        
            $kidSavouryFood = config('kidSavouryFood');
            $maxMainMeals = config('maxMainMeals');
            printFoodLists($kidSavouryFood, 'mainMeals', $packages[$booking->getPartyType()]['mainMeals'], $options['food']['mainMeals']);
            
            $kidSweetFood = config('kidSweetFood');
            $maxSweets = config('maxSweets');
            printFoodLists($kidSweetFood, 'sweets', $packages[$booking->getPartyType()]['sweets'], $options['food']['sweets']);
        ?>
    
    </div>
</div>

<div class="section">

    <h2><?php echo text('headingAdultPlatters'); ?></h2>
    
    <div class="sectionBody">

        <?php
            foreach ($adultPlatters as $adultPlatter) {
                ?>
                    <div class="row">
                        <div class="label">
                            <span class="title"><?php echo $adultPlatter['name']; ?></span>
                        </div>
                        <div class="field">
                            <?php echo $options['food']['adultPlatters'][$adultPlatter['id']]; ?>
                        </div>
                        <div class="clear"></div>
                    </div>
                <?php
            }
        ?>
    
    </div>
</div>

<div class="section">

    <h2><?php echo text('headingMoreOptions'); ?></h2>
    
    <div class="sectionBody">
    
        <?php
            foreach ($moreOptions as $option) {
                ?>
                    <div class="row">
                        <div class="label">
                            <span class="title"><?php echo $option['name']; ?></span>
                        </div>
                        <div class="field">
                            <?php echo $options['moreOptions'][$option['id']]; ?>
                        </div>
                        <div class="clear"></div>
                    </div>
                <?php
            }
        ?>
    
    </div>
</div>

<div class="section">

    <h2>Character</h2>
    
    <div class="sectionBody">

        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelCharacter'); ?></span></div>
            <div class="field">
                <?php echo ($options['character'] ? $options['character'] : "(none)"); ?>
            </div>
            <div class="clear"></div>
        </div>
    
    </div>
</div>

<div class="section">

    <h2><?php echo text('headingBirthdayBoyGirlDetails'); ?></h2>
    
    <div class="sectionBody">

        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelSubjectFirstname'); ?></span></div>
            <div class="field">
                <?php echo $booking->getSubjectFirstname(); ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelSubjectLastname'); ?></span></div>
            <div class="field">
                <?php echo $booking->getSubjectLastname(); ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelSubjectGender'); ?></span></div>
            <div class="field">
                <?php echo $booking->getSubjectGender(); ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label">
                <span class="title"><?php echo text('labelSubjectAge'); ?></span>
            </div>
            <div class="field">
                <?php echo $booking->getSubjectAge(); ?>
            </div>
            <div class="clear"></div>
        </div>
    
    </div>
</div>

<div class="section">

    <h2><?php echo text('headingPartyDetails'); ?></h2>
    
    <div class="sectionBody">
  
        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelDate'); ?></span></div>
            <div class="field">
                <?php echo date('j/n/Y', strtotime($booking->getBookingDatetime())) ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label">
                <span class="title"><?php echo text('labelArrivalTime'); ?></span>
            </div>
            <div class="field">
                <?php echo date('g:ia', strtotime($booking->getBookingDatetime())) ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label">
                <span class="title"><?php echo text('labelFoodTime'); ?></span>
            </div>
            <div class="field">
                <?php echo date('g:ia', strtotime($booking->getFoodDatetime())) ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label">
                <span class="title"><?php echo text('labelRoom'); ?></span>
            </div>
            <div class="field">
                <?php echo $booking->getRoom() ?>
            </div>
            <div class="clear"></div>
        </div>
    
    </div>
</div>

<div class="section">

    <h2><?php echo text('headingContactDetails'); ?></h2>
    
    <div class="sectionBody">

        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelContactFirstname'); ?></span></div>
            <div class="field">
                <?php echo $booking->getContactFirstname(); ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelContactLastname'); ?></span></div>
            <div class="field">
                <?php echo $booking->getContactLastname(); ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelContactPhone'); ?></span></div>
            <div class="field">
                <?php echo $booking->getContactPhone(); ?>
            </div>
            <div class="clear"></div>
        </div>
      
        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelContactEmail'); ?></span></div>
            <div class="field">
                <a href="mailto:<?php echo $booking->getContactEmail(); ?>"><?php echo $booking->getContactEmail(); ?></a>
            </div>
            <div class="clear"></div>
        </div>
    
    </div>
</div>

<div class="section">

    <h2><?php echo text('headingOther'); ?></h2>
    
    <div class="sectionBody">

        <div class="row">
            <div class="label"><span class="title"><?php echo text('labelNotes'); ?></span></div>
            <div class="field">
                <?php echo html_entity_decode($booking->getNotes()) ?>
            </div>
            <div class="clear"></div>
        </div>
    
    </div>
</div>

<a href="<?php echo url_for('bookings/index') ?>">&lt; Back to list</a>
